<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>华履云商</title>
</head>
<style type="text/css">*{margin:0;padding:0;}.hover{position:fixed;top:0;width:100%;z-index:1000;height:100%;font-size:20px;color:#FFEA03}.hover img{width:100%;height:100%}.hover .time{position:absolute;bottom:16%;left:50%;width:300px;margin-left:-150px}.hover .time span{float:left;width:100px;text-align:center;}</style>
<body>
	<div class="hover">
		<img src="/esvml/img/timeup.png">
		<div class="time">
			<span id="hour"></span>
			<span id="minute"></span>
			<span id="second"></span>
		</div>
	</div>
	<script type="text/javascript">

		var res = ajax(), time;

		if(res.result.intime) {
			time = res.result.longtime;
			getRTime();
			setInterval(getRTime, 1000);
			setInterval(function() {
				window.location.reload();
			}, 60000);
		}	else window.location.href = 'http://www.hualv.cn';


		function getRTime() {

			if(time <= 1000) window.location.href = 'http://www.hualv.cn';

	        var h = Math.floor(time/1000/60/60%24);
	        var m = Math.floor(time/1000/60%60);
	        var s = Math.floor(time/1000%60);

	        time -= 1000;

	       	document.getElementById('hour').innerHTML = h + ' 时';
	        document.getElementById('minute').innerHTML = m+ ' 分';
	        document.getElementById('second').innerHTML = s + ' 秒';
	    }

	    function ajax() {
	    	var xmlhttp = new XMLHttpRequest();
			xmlhttp.open('POST', '/control/pub/command', false);
			xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");  
			xmlhttp.send('command=com.jackrain.es.check.checkOpenDoorpub&getjson=true');
			return JSON.parse(xmlhttp.responseText)
	    }
	</script>
</body>
</html>